
/**
 * 生成随机字符串
 * @date 2024/2/2 - 17:02:59
 * @author 拉斯达
 *
 * @export
 * @param {*} length
 * @returns {string}
 */
export function getRandomString(length = 8) {
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  var result = "";

  for (var i = length; i > 0; --i) {
    result += chars[Math.floor(Math.random() * chars.length)];
  }

  return result;
}
